RedOferta = function(){
	return {
		selectionChange: function(records, form){
			if(records && records.length > 0){
				Asg.Form.setValues(form, records[0].data);
			}
		},
		confirmProcess: function(grid, rowIndex, currentId){
			Asg.Message.confirm(Asg.constants.CONFIRM_DELETE_MESSAGE, function(btn){
				if(btn != "no") RedOferta.deleteDetails(grid, rowIndex, currentId);
			});
		},
		deleteDetails: function(grid, rowIndex, currentId) {
			var path = "/red/oferta/";
			switch(currentId){
				case "redOfertaHorarioId":
					path += "deleteRedOfertaHorario";
					break;
				case "redOfertaFormacionAcademicaId":
					path += "deleteRedOfertaFormacionAcademica";
					break;
				case "redOfertaIdiomaId":
					path += "deleteRedOfertaIdioma";
					break;
				case "redOfertaConocimientoId":
					path += "deleteRedOfertaConocimiento";
					break;
				case "redOfertaHabilidadId":
					path += "deleteRedOfertaHabilidad";
					break;
				case "redOfertaSucursales.redOfertaSucursalId":
					path += "deleteRedOfertaSucursales";
					break;
				case "redOfertaContacto.redOfertaContactoId":
					path += "deleteRedOfertaContacto";
					break;
				default: return;
			}
 		   var rows = [grid.getStore().getAt(rowIndex)];
 		   var currentIdAsLong = rows[0].get(currentId);
 		   var redOfertaId = Asg.Utils.getValue("redOfertaId");
 		   Asg.Message.progress("Actualizando Informaci\u00F3n...");
 		   Ext.Ajax.request({
              timeout: Asg.constants.TIMEOUT_SECONDS,
              url: Asg.constants.CONTEXT_PATH + path,
              params: {redOfertaId: redOfertaId, currentId: currentIdAsLong},
              callback: function(options, success, response){
                  Ext.Msg.hide();
                  var jsonObject = Asg.Utils.ajaxRequestGetJson(response);
                  if(!success || !jsonObject || jsonObject.failure){
                      Asg.Message.alertInvalid(Asg.constants.DEFAULT_ERROR_MESSAGE);
                      return
                  }
                  if(!Ext.isEmpty(jsonObject.message)) Asg.Message.alert(jsonObject.message);
                  if(jsonObject.list){
						Asg.Grid.loadData(grid.id, jsonObject.list);
						if(currentId == "redOfertaSucursales.redOfertaSucursalId"){
							Asg.Combo.loadData("redOfertaContactoSucursalId", jsonObject.list);
						}
					}
              }
           });
 	    },
		resetFormDetails: function(form){
			form = Ext.getCmp(form);
			form.getForm().reset();
		},
		saveDetails: function(form, grid){
			if(Ext.isEmpty(Asg.Utils.getValue("redOfertaId"))) {
				Asg.Message.alertInvalid("Debe Guardar la Oferta antes de continuar");
				return;
			}
			
			//Hugo Gonzalez, EDC, 27-09-2012
			if(form=="redOfertaHorarioForm"){
				var diaInicial = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioDiaInicio");
				var diaFinal = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioDiaFin");
				var horaInicial = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioHoraInicio");
				var horaFinal = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioHoraFin");
				var amPmInicial = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioInicioAmPm");
				var amPmFinal = Asg.Utils.getValue("redOfertaHorario.redOfertaHorarioFinAmPm");
				
				var horarios = Ext.getCmp("redOfertaHorarioGrid").getStore().data;
				
				for (var i=0; i<horarios.items.length; i++) {
	    		    var item = horarios.items[i];
	    		    
	    		    if(diaInicial == item.data["redOfertaHorarioDiaInicio"]
	    		       && horaInicial == item.data["redOfertaHorarioHoraInicio"]
	    		       && amPmInicial == item.data["redOfertaHorarioInicioAmPm"]
	    		       && diaFinal == item.data["redOfertaHorarioDiaFin"]
	    		       && horaFinal == item.data["redOfertaHorarioHoraFin"]
	    		       && amPmFinal == item.data["redOfertaHorarioFinAmPm"]
	    		    ){ 	    		    		
	    		    	Asg.Message.alert("Horario duplicado!");
	         		    return;
	    		    }
	    		}				
			}//Hugo Gonzalez, EDC, 27-09-2012
			
			if(form=="redOfertaIdiomaForm"){
				var idioma = Asg.Utils.getValue("redOfertaIdioma.ctgIdioma.ctgCatalogoId");
				var idiomas = Ext.getCmp("redOfertaIdiomaGrid").getStore().data;
				
				for (var i=0; i<idiomas.items.length; i++) {
	    		    var item = idiomas.items[i];	    		    
	    		    if(idioma == item.data["ctgIdiomaId"]){ 	    		    		
	    		    	Asg.Message.alert("Idioma duplicado!");
	         		    return;
	    		    }
	    		}
			}
			
			
			var path = "/red/oferta/";
			var params = {};
			var redOfertaId = Asg.Utils.getValue("redOfertaId");;
			switch(form){
				case "redOfertaHorarioForm":
					path += "saveRedOfertaHorario";
					params["redOfertaHorario.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaFormacionAcademicaForm":
					path += "saveRedOfertaFormacionAcademica";
					params["redOfertaFormacionAcademica.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaIdiomaForm":
					path += "saveRedOfertaIdioma";
					params["redOfertaIdioma.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaConocimientosForm":
					path += "saveRedOfertaConocimiento";
					params["redOfertaConocimiento.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaHabilidadForm":
					path += "saveRedOfertaHabilidad";
					params["redOfertaHabilidad.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaSucursalesForm":
					path += "saveRedOfertaSucursales";
					params["redOfertaSucursales.redOferta.redOfertaId"] = redOfertaId;
					break;
				case "redOfertaContactoForm":
					path += "saveRedOfertaContacto";
					params["redOfertaContacto.redOferta.redOfertaId"] = redOfertaId;
					break;
				default: return;
			}
			form = Ext.getCmp(form);
			Asg.Message.progress("Guardando Informaci\u00F3n...");
			form.getForm().submit({
    			url: Asg.constants.CONTEXT_PATH + path,
    			timeout: Asg.constants.TIMEOUT_SECONDS,
    			reset: true,
    			params: params,
    			success: function(form, action){
    				Asg.Message.alert(action.result.message);
					if(action.result.success){
						if(action.result.list){
							Asg.Grid.loadData(grid, action.result.list);
							if(form.id == "redOfertaSucursalesForm"){
								Asg.Combo.loadData("redOfertaContactoSucursalId", action.result.list);
							}
						}
					}
    			},
    			failure: Asg.Form.failureProcedure
   			});
		},
		move: function(layout, direction){
			layout[direction]();
			Ext.getCmp("redOfertaSiguienteButton").setDisabled(!layout.getPrev());
		    Ext.getCmp("redOfertaAnteriorButton").setDisabled(!layout.getNext());
		},
		navigate: function(panel, direction){
		    var layout = panel.getLayout();
		    var form = layout.getActiveItem();
		    var formId = form.getId();
		    var jsonParams = {};
		    if(formId == "redOfertaPaso4" || formId == "redOfertaPaso5"){
		    	RedOferta.move(layout, direction);
		    	return;
		    }else{
		    	var path = "/red/oferta/";
		    	var params = {};
		    	switch(formId){
		    		case "redOfertaForm":
		    			path += "saveRedOferta";
		    			params["redOferta.redOfertaId"] = Asg.Utils.getValue("redOfertaId");
		    			break;
		    		case "redOfertaPaso2":
		    			form = Ext.getCmp("redOfertaDatosForm");
		    			path += "saveRedOfertaDatos";
		    			params["redOfertaDatos.redOferta.redOfertaId"] = Asg.Utils.getValue("redOfertaId");
		    			break;
		    		case "redOfertaRequisitosForm":
		    			path += "saveRedOfertaRequisitos";
		    			params["redOfertaRequisito.redOferta.redOfertaId"] = Asg.Utils.getValue("redOfertaId");
		    			break;
		    		case "redOfertaPaso6":
		    			form = Ext.getCmp("redOfertaEntrevistaForm");
		    			path += "saveRedOfertaDatosEntrevista";
		    			params["redOfertaDatosEntrevista.redOferta.redOfertaId"] = Asg.Utils.getValue("redOfertaId");
		    			break;
		    		default: return;
		    	}
		    	Asg.Message.progress("Guardando Informaci\u00F3n...");
			    form.getForm().submit({
	    			url: Asg.constants.CONTEXT_PATH + path,
	    			timeout: Asg.constants.TIMEOUT_SECONDS,
	    			params: params,
	    			success: function(form, action){
	    				Asg.Message.alert(action.result.message);
						if(action.result.success){
							if(action.result.redOfertaId) Asg.Utils.setValue("redOfertaId", action.result.redOfertaId);
							if(action.result.redOfertaFecha) Asg.Utils.setValue("redOfertaFecha", action.result.redOfertaFecha);
							RedOferta.move(layout, direction);
						}
	    			},
	    			failure: Asg.Form.failureProcedure
	   			});
		    }
		},
		openWindow: function(redOfertaId){
			Asg.Message.progress("Cargando Informaci\u00F3n...");
            Ext.Ajax.request({
                timeout: Asg.constants.TIMEOUT_SECONDS,
                url: Asg.constants.CONTEXT_PATH + "/red/oferta/findById",
                params: {redOfertaId: redOfertaId},
                callback: function(options, success, response){
                    Ext.Msg.hide();
                    var jsonObject = Asg.Utils.ajaxRequestGetJson(response);
                    if(!success || !jsonObject || jsonObject.failure){
                        Asg.Message.alertInvalid(Asg.constants.DEFAULT_ERROR_MESSAGE);
                        return
                    }
                    RedOferta.showWindow(jsonObject);
                }
            });
		},
		//Agregado por Hugo Gonzalez para ser invocado desde el mantenimiento de Empresas
		openWindowByEmpresas: function(redEmpresaFolio){
			var redOfertaId;
			Asg.Message.progress("Cargando Informaci\u00F3n...");
            Ext.Ajax.request({
                timeout: Asg.constants.TIMEOUT_SECONDS,
                url: Asg.constants.CONTEXT_PATH + "/red/oferta/findById",
                params: {redOfertaId: redOfertaId},
                callback: function(options, success, response){
                    Ext.Msg.hide();
                    var jsonObject = Asg.Utils.ajaxRequestGetJson(response);
                    if(!success || !jsonObject || jsonObject.failure){
                        Asg.Message.alertInvalid(Asg.constants.DEFAULT_ERROR_MESSAGE);
                        return
                    }
                    //Hack para setear el id de la empresa desde el inicio.
                    //jsonObject.redOferta.redEmpresaFolio = redEmpresaFolio;                    
                    if(!jsonObject.redOferta){
                    	jsonObject.redOferta = {};
                    	jsonObject.redOferta.redEmpresaFolio = redEmpresaFolio;
                    }
                    
                    RedOferta.showWindow(jsonObject);
                }
            });
		},
		showWindow: function(config){
			if(!config) config = {};
			if(!config.redOferta) config.redOferta = {};
			if(!config.redOfertaDatos) config.redOfertaDatos = {};
			if(!config.redOfertaRequisito) config.redOfertaRequisito = {};
			if(!config.redOfertaDatosEntrevista) config.redOfertaDatosEntrevista = {};
			if(!config.catalogos) config.catalogos = {};
			new Ext.Window({
				width: 850,
				height: 500,
				layout: "fit",
				id: "redOfertaWindow",
				maximizable: true,
				modal: true,
				title: Asg.constants.APPLICATION_TITLE,
				items: {
					border: false,
					layout: "card",
					//activeItem: 5,
					items: [
				        {
				        	xtype: "form",
				        	id: "redOfertaForm",
				        	title: "Paso #1: Secci\u00F3n de Control",
				        	border: false,
	        	        	bodyPadding: "5 5 5 5",
	        	        	autoScroll: true,
	        	        	layout: {
	        	        		type: "table",
								columns: 2,
								tableAttrs: {
						            style: {width: "415px", "margin-top": "5px;"},
						            align: "center"
								}
	        	        	},
	        	        	defaults: Asg.Form.defaults({width: 300}),
	        	        	items: [
    	        	        	{xtype: "label", text: "No. Folio:", cls: "x-form-item", width: 100},
    	        	        	{
    	        	        		xtype: "textfield",
    	        	        		id: "redOfertaId",
    	        	        		name: "redOferta.redOfertaId",
    	        	        		value: config.redOferta.redOfertaId,
    	        	        		disabled: true
    	        	        	},
    	        	        	{xtype: "label", text: "Fecha Registro:", cls: "x-form-item", width: 100},
    	        	        	{
    	        	        		xtype: "textfield",
    	        	        		id: "redOfertaFecha",
    	        	        		name: "redOferta.redOfertaFecha",
    	        	        		value: config.redOferta.redOfertaFecha,
    	        	        		disabled: true
    	        	        	},
    	        	        	{xtype: "label", text: "No. Oficina Red:", cls: "x-form-item", width: 100},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOferta.ctgOficinas.ctgOficinaId",
    	        	        		value: config.redOferta.ctgOficinaId,
    	        	        		allowBlank: false,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: config.catalogos.ctgOficinas || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},
    	        	        	{xtype: "label", text: "Gestor/a Empleo:", cls: "x-form-item", width: 100},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOferta.ctgEmpleados.ctgEmpleadoId",
    	        	        		value: config.redOferta.ctgEmpleadoId,
    	        	        		allowBlank: false,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: config.catalogos.ctgEmpleados || [],
                                        fields: ["value", "value1", "id"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},
    	        	        	{xtype: "label", text: "Empresa:", cls: "x-form-item", width: 100},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOferta.redEmpresa.redEmpresaFolio",
    	        	        		value: config.redOferta.redEmpresaFolio,
    	        	        		allowBlank: false,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: config.catalogos.redEmpresas || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},{
    	        	        		xtype: "hidden",
    	        	        		name: "redOferta.redOfertaActivo",
    	        	        		value: config.redOferta.redOfertaActivo || "0",
    	        	        		width: 10
    	        	        	}
	        	        	]
				        },{
				        	id: "redOfertaPaso2",
				        	title: "Paso #2: Datos de la Oferta",
				        	border: false,
				        	autoScroll: true,
				        	items: [
				        		{
						        	xtype: "form",
						        	id: "redOfertaDatosForm",
						        	border: false,
			        	        	bodyPadding: "5 5 5 5",
			        	        	layout: {
			        	        		type: "table",
										columns: 2,
										tableAttrs: {
								            style: {width: "665px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({width: 400}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "Puesto Ofrecido:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaDatos.redOfertaDatoPuesto",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoPuesto,
		    	        	        		allowBlank: false,
		    	        	        		maxLength: 50, maxLength: 25, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Ocupaci\u00F3n:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.ctgOcupacion.ocupacionCodigo",
		    	        	        		value: config.redOfertaDatos.ctgOcupacionId,
		    	        	        		editable: false,
		    	        	        		selectOnFocus: false,
		    	        	        		flex: 1,
		    	        	        		typeAhead: false,
		    	        	        		allowBlank: false,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: config.catalogos.ctgOcupaciones || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id" //06-11-2012 Agregado por Hugo 'hkadejo' Gonzalez
		    	        	        	},
		    	        	        	{xtype: "label", text: "No. Plazas:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "numberfield",
		    	        	        		name: "redOfertaDatos.redOfertaDatoCantidadPlazas",
		    	        	        		allowBlank: false,
		    	        	        		value: config.redOfertaDatos.redOfertaDatoCantidadPlazas,
		    	        	        		allowDecimals: false,
		    	        	        		hideTrigger: true,
		    	        	        		maxLength: 8
		    	        	        	},
		    	        	        	{xtype: "label", text: "Salario Ofrecido:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "numericfield",
		    	        	        		name: "redOfertaDatos.redOfertaDatoSalario",
		    	        	        		allowBlank: false,
		    	        	        		value: config.redOfertaDatos.redOfertaDatoSalario,
		    	        	        		maxLength: 8
		    	        	        	},
		    	        	        	{xtype: "label", text: "Forma de Pago:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.ctgFormaPago.ctgCatalogoId",
		    	        	        		value: config.redOfertaDatos.ctgFormaPagoId,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: config.catalogos.ctgFormasPago || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id", maxLength: 25, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Periocidad de Pago:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.redOfertaDatoPeriodicidadPago",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoPeriodicidadPago,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: [["1", "CATORCENAL"], ["2", "DIARIO"], ["3", "MENSUAL"], ["4", "QUINCENAL"], ["5", "SEMANAL"]],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id"
		    	        	        	},
		    	        	        	{xtype: "label", text: "Forma de Contrataci\u00F3n:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.redOfertaDatoFormaContratacion",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoFormaContratacion,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: [["1", "PERMANENTE"], ["2", "TEMPORAL"]],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id", maxLength: 25, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Prestaciones Ofrecidas:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: 'checkboxgroup',
		    	        	        		columns: 2,
		    	        	        		vertical: true,
		    	        	        		maxHeight: 50,
		    	        	        		height: 50,
		    	        	        		autoScroll: true,
		    	        	        		items: config.redOfertaPrestaciones || []
		    	        	        	},
		    	        	        	{xtype: "label", text: "Jornada de Trabajo:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.ctgJornadaLaboral.ctgCatalogoId",
		    	        	        		value: config.redOfertaDatos.ctgJornadaLaboralId,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: config.catalogos.ctgJornadaLaborales || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id", maxLength: 25, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Periodo de Prueba (D\u00EDas):", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "numberfield",
		    	        	        		name: "redOfertaDatos.redOfertaDatoPeriodoPrueba",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoPeriodoPrueba,
		    	        	        		allowDecimals: false,
		    	        	        		hideTrigger: true,
		    	        	        		maxLength: 5
		    	        	        	},
		    	        	        	{xtype: "label", text: "\u00BFLa oferta requiere persona con discapcidad\u003F:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaDatos.redOfertaDatoDiscapacidad",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoDiscapacidad,
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: Asg.Combo.yesnoArray(),
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id", maxLength: 2, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Descripci\u00F3n General del Puesto:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "textarea",
		    	        	        		name: "redOfertaDatos.redOfertaDatoDescripcion",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoDescripcion,
		    	        	        		height: 50, maxLength: 25, vtype:'letranum'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},
		    	        	        	{xtype: "label", text: "Funciones:", cls: "x-form-item", width: 250},
		    	        	        	{
		    	        	        		xtype: "textarea",
		    	        	        		name: "redOfertaDatos.redOfertaDatoFunciones",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoFunciones,
		    	        	        		height: 50, maxLength: 75, vtype:'letranum'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "hidden",
		    	        	        		name: "redOfertaDatos.redOfertaDatoId",
		    	        	        		value: config.redOfertaDatos.redOfertaDatoId,
		    	        	        		width: 10
		    	        	        	}
	    	        	        	]
					        	},{
					        		xtype: "form",
						        	id: "redOfertaHorarioForm",
						        	border: false,
			        	        	bodyPadding: "5 5 5 5",
			        	        	layout: {
			        	        		type: "table",
										columns: 6,
										tableAttrs: {
								            style: {width: "665px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", allowBlank: false}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "- Horario de Trabajo -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 6},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		id:"redOfertaHorario.redOfertaHorarioDiaInicio",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioDiaInicio",
		    	        	        		fieldLabel: "De",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: Asg.Combo.daysOfWeek(),
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                width: 100, maxLength: 10, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		id: "redOfertaHorario.redOfertaHorarioHoraInicio",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioHoraInicio",
		    	        	        		fieldLabel: "Desde",
		    	        	        		vtype: "hora",
		    	        	        		width: 80
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		id: "redOfertaHorario.redOfertaHorarioInicioAmPm",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioInicioAmPm",
		    	        	        		fieldLabel: "AM/PM",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: [["AM", "AM"], ["PM", "PM"]],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                width: 80, maxLength: 2, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		id: "redOfertaHorario.redOfertaHorarioDiaFin",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioDiaFin",
		    	        	        		fieldLabel: "a",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: Asg.Combo.daysOfWeek(),
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                width: 100, maxLength: 10, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		id: "redOfertaHorario.redOfertaHorarioHoraFin",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioHoraFin",
		    	        	        		fieldLabel: "Hasta",
		    	        	        		vtype: "hora",
		    	        	        		width: 80
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		id: "redOfertaHorario.redOfertaHorarioFinAmPm",
		    	        	        		name: "redOfertaHorario.redOfertaHorarioFinAmPm",
		    	        	        		fieldLabel: "AM/PM",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: [["AM", "AM"], ["PM", "PM"]],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                width: 80, maxLength: 2, vtype:'letra'//28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		                            		xtype: "grid",
		                            		id: "redOfertaHorarioGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaHorarioId",
													"redOfertaHorarioDiaInicio",
													"redOfertaHorarioHoraInicio",
													"redOfertaHorarioInicioAmPm",
													"redOfertaHorarioDiaFin",
													"redOfertaHorarioHoraFin",
													"redOfertaHorarioFinAmPm"
												],
												data: config.redOfertaHorarioList || []
		                            		}),
		                            		columns: [
													{
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												        {
												     	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												     	   iconCls: "icon", 
												     	   handler: function(grid, rowIndex, colIndex) {
												     		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaHorarioId");
												     	   }
												        }
												    ]
												  },
		                        		          {header: "D\u00EDa Inicial", dataIndex: "redOfertaHorarioDiaInicio", flex: 1, renderer: Asg.Combo.decodeDay},
		                        		          {header: "Hora Inicial", dataIndex: "redOfertaHorarioHoraInicio", flex: 1},
		                        		          {dataIndex: "redOfertaHorarioInicioAmPm", flex: 1},
		                        		          {header: "D\u00EDa Final", dataIndex: "redOfertaHorarioDiaFin", flex: 1, renderer: Asg.Combo.decodeDay},
		                        		          {header: "Hora Inicial", dataIndex: "redOfertaHorarioHoraFin", flex: 1},
		                        		          {dataIndex: "redOfertaHorarioFinAmPm", flex: 1}
		                    		        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaHorarioForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaHorarioForm","redOfertaHorarioGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 655,
		    	        	        		height: 200,
		    	        	        		colspan: 6
		    	        	        	}
	    	        	        	]
					        	}
	        	        	]
				        },{
				        	xtype: "form",
				        	id: "redOfertaRequisitosForm",
				        	title: "Paso #3: Requisitos Generales del Puesto",
				        	border: false,
	        	        	bodyPadding: "5 5 5 5",
	        	        	autoScroll: true,
	        	        	layout: {
	        	        		type: "table",
								columns: 4,
								tableAttrs: {
						            style: {width: "565px", "margin-top": "5px;"},
						            align: "center"
								}
	        	        	},
	        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 400, colspan: 2}),
	        	        	items: [
    	        	        	{xtype: "label", text: "Experiencia:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "numberfield",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoExperiencia",
    	        	        		id: "redOfertaRequisito.redOfertaRequisitoExperiencia",
    	        	        		allowBlank: false,
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoExperiencia,
    	        	        		allowDecimals: false,
    	        	        		maxLenght: 2,    	        	        		
    	        	                minValue: 1, //prevents negative numbers
    	        	                maxValue:99
    	        	        			
    	        	        	},
    	        	        	{xtype: "label", text: "Rango de Edad Preferente:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "checkbox",
    	        	        		id: "redOfertaRequisito.redOfertaRequisitoIndiferente",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoIndiferente",
    	        	        		allowBlank: false,
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoIndiferente,
    	        	        		fieldLabel: "Indiferente",
    	        	        		listeners: {
                                        change: function(){
                                           var checkbox1 = Ext.getCmp('redOfertaRequisito.redOfertaRequisitoIndiferente');
                                           var edadMinima = Ext.getCmp('redOfertaRequisito.redOfertaRequisitoEdaMinima'); 
                                       	var edadMaxima = Ext.getCmp('redOfertaRequisito.redOfertaRequisitoEdaMaxima');
                                           if(checkbox1.getValue(false)){                                            	
                                               edadMinima.disabled=true;
                                               edadMinima.setValue('');
                                               edadMaxima.disabled=true;
                                               edadMaxima.setValue('');                                                
                                           } else {
                                           	Ext.getCmp('redOfertaRequisito.redOfertaRequisitoEdaMinima').disabled=false;
                                           	Ext.getCmp('redOfertaRequisito.redOfertaRequisitoEdaMaxima').disabled=false;
                                           }
                                        }
                                    }
    	        	        	},
    	        	        	{xtype: "hidden", width: 150},
    	        	        	{
    	        	        		xtype: "numberfield",
    	        	        		id: "redOfertaRequisito.redOfertaRequisitoEdaMinima",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoEdaMinima",
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoEdadMinima,
    	        	        		fieldLabel: "Edad Inicial",
    	        	        		allowDecimals: false,
    	        	        		minValue: 0, //prevents negative numbers
    	        	        		width: 150,
    	        	        		colspan: 1,
    	        	        		maxLength: 2,
    	        	        		labelAlign: "left",
    	        	        		//hideTrigger: true,
    	        	                //keyNavEnabled: false,
    	        	                //mouseWheelEnabled: false,
    	        	                enableKeyEvents : true,
    	        	                listeners : {
    	        	                	keypress : function (item, e) {
    	        	                            e.stopEvent();    	        	                           
    	        	                        }    	        	                    
    	        	                }
    	        	        	
    	        	        	},{
    	        	        		xtype: "numberfield",
    	        	        		id: "redOfertaRequisito.redOfertaRequisitoEdaMaxima",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoEdaMaxima",
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoEdadMaxima,
    	        	        		fieldLabel: "Edad Final",
    	        	        		allowDecimals: false,
    	        	        		minValue: 0, //prevents negative numbers
    	        	        		width: 150,
    	        	        		colspan: 1,
    	        	        		maxLength: 2,
    	        	        		labelAlign: "left",
    	        	        		//hideTrigger: true,
    	        	                //keyNavEnabled: false,
    	        	                //mouseWheelEnabled: false
    	        	                enableKeyEvents : true,
    	        	                listeners : {
    	        	                	keypress : function (item, e) {
    	        	                            e.stopEvent();    	        	                           
    	        	                        }    	        	                    
    	        	                }
    	        	        	},
    	        	        	{xtype: "label", text: "Sexo:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "checkbox",
    	        	        		fieldLabel: "Indiferente",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoSexoIndiferente",
    	        	        		allowBlank: false,
    	        	        		id: "redOfertaRequisito.redOfertaRequisitoSexoIndiferente",
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoSexoIndiferente,
                                                listeners: {
                                                    change: function(){
                                                       var checkbox1 = Ext.getCmp('redOfertaRequisito.redOfertaRequisitoSexoIndiferente');
                                                       if(checkbox1.getValue(false)){
                                                           Ext.getCmp('redOfertaRequisito.ctgGenero.ctgCatalogoId').disabled=true;
                                                           Ext.getCmp('redOfertaRequisito.ctgGenero.ctgCatalogoId').setValue('');
                                                       } else {
                                                           Ext.getCmp('redOfertaRequisito.ctgGenero.ctgCatalogoId').disabled=false;
                                                       }
                                                    }
                                                }
    	        	        	
    	        	        	},
    	        	        	{xtype: "hidden", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOfertaRequisito.ctgGenero.ctgCatalogoId",
    	        	        		id: "redOfertaRequisito.ctgGenero.ctgCatalogoId",
    	        	        		value: config.redOfertaRequisito.ctgGeneroId,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: config.catalogos.ctgGeneros || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},
    	        	        	{xtype: "label", text: "Estado Familiar:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOfertaRequisito.ctgEstadoCivil.ctgCatalogoId",
    	        	        		value: config.redOfertaRequisito.ctgEstadoCivilId,
    	        	        		store: new Ext.data.SimpleStore({
    	        	        			data: config.catalogos.ctgEstadosCiviles || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id",
	                                id: "ctgEstadoCivilCombo",
	                                listeners: {
	 					    		   beforerender: function(){
	 					    			   var combo = Ext.getCmp('ctgEstadoCivilCombo');
	 					    			   combo.setValue(187);
	 					    		   }
	                                }
    	        	        	},
    	        	        	{xtype: "label", text: "Consideraciones:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "textarea",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoCarateristicasPersonales",
    	        	        		value: config.redOfertaDatos.redOfertaRequisitoCarateristicasPersonales,
    	        	        		height: 50
    	        	        	},
    	        	        	{xtype: "label", text: "Documentos a Presentar:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: 'checkboxgroup',
    	        	        		columns: 2, 
    	        	        		vertical: true,
    	        	        		height: 200,
    	        	        		items: config.redOfertaDocumentos || []
    	        	        	},    	        	        	
    	        	        	{xtype: "label", text: "Otros Requisitos:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: 'checkboxgroup',
    	        	        		columns: 2,
    	        	        		vertical: true,
    	        	        		height: 100,
    	        	        		items: config.redOfertaOtrosRequisitos || []
    	        	        	},
    	        	        	{xtype: "label", text: "Licencia de Conducir:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOfertaDatos.redOfertaRequisitoLicencia",
    	        	        		id: "redOfertaDatos.redOfertaRequisitoLicencia",
    	        	        		value: config.redOfertaDatos.redOfertaRequisitoLicencia,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: Asg.Combo.yesnoArray(),
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id",
                                        listeners: {
                                            change: function(){
                                                    var comp = Ext.getCmp('redOfertaDatos.redOfertaRequisitoLicencia');
                                                    if(comp.getValue(false)==0){
                                                        Ext.getCmp('redOfertaRequisito.ctgTipoLicencia.ctgCatalogoId').setValue('');
                                                        Ext.getCmp('redOfertaRequisito.ctgTipoLicencia.ctgCatalogoId').disabled=true;
                                                    } else {
                                                        Ext.getCmp('redOfertaRequisito.ctgTipoLicencia.ctgCatalogoId').disabled=false;
                                                    }
                                                }
                                            }
    	        	        	
    	        	        	},
    	        	        	{xtype: "label", text: "Clase de Licencia:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOfertaRequisito.ctgTipoLicencia.ctgCatalogoId",
    	        	        		id: "redOfertaRequisito.ctgTipoLicencia.ctgCatalogoId",
    	        	        		value: config.redOfertaRequisito.ctgTipoLicenciaId,
    	        	        		store: new Ext.data.SimpleStore({
    	        	        			data: config.catalogos.ctgTipoLicencias || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},
    	        	        	{xtype: "label", text: "Veh\u00EDculo:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		id: "redOfertaDatos.redOfertaRequisitoVehiculo",
    	        	        		name: "redOfertaDatos.redOfertaRequisitoVehiculo",
    	        	        		value: config.redOfertaDatos.redOfertaRequisitoVehiculo,
    	        	        		store: new Ext.data.SimpleStore({
                                        data: Asg.Combo.yesnoArray(),
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id",
	                                listeners: {
                                        change: function(){
                                           var combo1 = Ext.getCmp('redOfertaDatos.redOfertaRequisitoVehiculo');
                                           var tipo = Ext.getCmp('redOfertaRequisito.ctgTipoVehiculo.ctgCatalogoId');
                                           var anio = Ext.getCmp('redOfertaDatos.redOfertaRequisitoAnioVehiculo');
                                           if(combo1.getValue() == "0" ){
                                               tipo.setValue('');
                                               tipo.disabled = true;
                                               anio.setValue('');
                                               anio.disabled = true;
                                           } else {
                                               tipo.disabled = false;
                                               anio.disabled = false;
                                           }
                                        }
                                    }
    	        	        	},
    	        	        	{xtype: "label", text: "Tipo de Veh\u00EDculo:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		editable: false,
    	        	        		selectOnFocus: false,
    	        	        		flex: 1,
    	        	        		typeAhead: false,
    	        	        		id: "redOfertaRequisito.ctgTipoVehiculo.ctgCatalogoId",
    	        	        		name: "redOfertaRequisito.ctgTipoVehiculo.ctgCatalogoId",
    	        	        		value: config.redOfertaRequisito.ctgTipoVehiculo,
    	        	        		store: new Ext.data.SimpleStore({
    	        	        			data: config.catalogos.ctgTipoVehiculos || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},
//    	        	        	{xtype: "label", text: "A\u00F1o:", cls: "x-form-item", width: 150},
//    	        	        	{
//    	        	        		xtype: "numberfield",
//    	        	        		id: "redOfertaDatos.redOfertaRequisitoAnioVehiculo",
//    	        	        		name: "redOfertaDatos.redOfertaRequisitoAnioVehiculo",
//    	        	        		value: config.redOfertaDatos.redOfertaRequisitoAnioVehiculo,
//    	        	        		minLength: 4,
//    	        	        		maxLength: 4,
//    	        	        		allowDecimals: false,
//    	        	        		minValue: 0 //prevents negative numbers
//    	        	        	},
    	        	        	{xtype: "label", text: "Disponibilidad:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: 'checkboxgroup',
    	        	        		columns: 2,
    	        	        		vertical: true,
    	        	        		height: 100,
    	        	        		items: config.redOfertaDisponibilidad || []
    	        	        	},
    	        	        	{xtype: "label", text: "Incorporaci\u00F3n:", cls: "x-form-item", width: 150},
    	        	        	{
    	        	        		xtype: "combo",
    	        	        		name: "redOfertaRequisito.ctgIncorporacion.ctgCatalogoId",
    	        	        		value: config.redOfertaRequisito.ctgIncorporacionId,
    	        	        		store: new Ext.data.SimpleStore({
    	        	        			data: config.catalogos.ctgTipoIncoporaciones || [],
                                        fields: ["id", "value"]
	                                }),
	                                displayField: "value",
	                                valueField: "id"
    	        	        	},{
    	        	        		xtype: "hidden",
    	        	        		name: "redOfertaRequisito.redOfertaRequisitoId",
    	        	        		value: config.redOfertaRequisito.redOfertaRequisitoId,
    	        	        		width: 10
    	        	        	}
	        	        	]
				        },{
				        	id: "redOfertaPaso4",
				        	title: "Paso #4: Formaci\u00F3n Acad\u00E9mica",
				        	border: false,
				        	autoScroll: true,
				        	items: [
			        	        {
						        	xtype: "form",
						        	id: "redOfertaFormacionAcademicaForm",
						        	border: false,
			        	        	bodyPadding: "5 5 5 5",
			        	        	layout: {
			        	        		type: "table",
										columns: 2,
										tableAttrs: {
								            style: {width: "615px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, allowBlank: false}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "- Formaci\u00F3n Acad\u00E9mica -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 2},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaFormacionAcademica.ctgEscolaridad.ctgCatalogoId",
		    	        	        		fieldLabel: "Escolaridad",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: config.catalogos.ctgEscolaridades || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                id: "ctgEscolaridad.ctgCatalogoId",
			                                listeners: {
			                                	   beforerender: function(){
			                                		  var combo = Ext.getCmp('ctgEscolaridad.ctgCatalogoId');
			                                		  combo.setValue(84);
			                                	   }
			                                	}
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaFormacionAcademica.ctgEspecialidad.ctgCatalogoId",
		    	        	        		fieldLabel: "Especialidad",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: config.catalogos.ctgEspecialidades || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                id: "ctgEspecialidad.ctgCatalogoId",
			                                listeners: {
			                                	   beforerender: function(){
			                                		  var combo = Ext.getCmp('ctgEspecialidad.ctgCatalogoId');
			                                		  combo.setValue(186);
			                                	   }
			                                	}
		    	        	        	},{
		                            		xtype: "grid",
		                            		id: "redOfertaFormacionAcademicaGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaFormacionAcademicaId",
													"ctgEscolaridadNombre",
													"ctgEspecialidadNombre"
												],
												data: config.redOfertaFormacionAcademicaList || []
		                            		}),
		                            		columns: [
	                            		          {
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												        {
												     	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												     	   iconCls: "icon", 
												     	   handler: function(grid, rowIndex, colIndex) {
												     		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaFormacionAcademicaId");
												     	   }
												        }
												    ]
												  },
		                        		          {header: "Escolaridad", dataIndex: "ctgEscolaridadNombre", flex: 1},
		                        		          {header: "Especialidad", dataIndex: "ctgEspecialidadNombre", flex: 1}
		                    		        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaFormacionAcademicaForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaFormacionAcademicaForm","redOfertaFormacionAcademicaGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 2
		    	        	        	}
	    	        	        	]
			        	        },{
						        	xtype: "form",
						        	id: "redOfertaIdiomaForm",
						        	border: false,
			        	        	bodyPadding: "5 5 5 5",
			        	        	layout: {
			        	        		type: "table",
										columns: 2,
										tableAttrs: {
								            style: {width: "615px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, allowBlank: false}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "- Idiamos Extranjeros -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 2},
		    	        	        	{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaIdioma.ctgIdioma.ctgCatalogoId",
		    	        	        		id: "redOfertaIdioma.ctgIdioma.ctgCatalogoId",
		    	        	        		fieldLabel: "Idioma",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: config.catalogos.ctgIdiomas || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                listeners: {
			                                	   beforerender: function(){
			                                		  var combo = Ext.getCmp('redOfertaIdioma.ctgIdioma.ctgCatalogoId');
			                                		  combo.setValue(70);
			                                	   }
			                                	}
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaIdioma.ctgNivel.ctgCatalogoId",
		    	        	        		id: "redOfertaIdioma.ctgNivel.ctgCatalogoId",
		    	        	        		fieldLabel: "Nivel",
		    	        	        		store: new Ext.data.SimpleStore({
		    	        	        			data: config.catalogos.ctgNiveles || [],
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id",
			                                listeners: {
			                                	   beforerender: function(){
			                                		  var combo = Ext.getCmp('redOfertaIdioma.ctgNivel.ctgCatalogoId');
			                                		  combo.setValue(83);
			                                	   }
			                                	}
		    	        	        	},{
		                            		xtype: "grid",
		                            		id: "redOfertaIdiomaGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaIdiomaId",
													"ctgIdiomaNombre",
													"ctgNivelNombre",
													"ctgIdiomaId"
												],
												data: config.redOfertaIdiomaList || []
		                            		}),
		                            		columns: [
	                            		          {
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												        {
												     	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												     	   iconCls: "icon", 
												     	   handler: function(grid, rowIndex, colIndex) {
												     		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaIdiomaId");
												     	   }
												        }
												    ]
												  },
		                        		          {header: "Idioma", dataIndex: "ctgIdiomaNombre", flex: 1},
		                        		          {header: "Nivel", dataIndex: "ctgNivelNombre", flex: 1}
		                    		        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaIdiomaForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaIdiomaForm","redOfertaIdiomaGrid");
		                		            	   }
		                		               }
		                		            	 
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 2
		    	        	        	},
			        	        	]
						        }
		        	        ]
				        },{
				        	id: "redOfertaPaso5",
				        	title: "Paso #5: Conocimientos y Habilidades",
				        	border: false,
				        	autoScroll: true,
				        	items: [
			        	        {
						        	xtype: "form",
						        	id: "redOfertaConocimientosForm",
			        	        	bodyPadding: "5 5 5 5",
			        	        	border: false,
			        	        	layout: {
			        	        		type: "table",
										columns: 2,
										tableAttrs: {
								            style: {width: "615px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, allowBlank: false}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "- Conocimientos -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 2},
		    	        	        	{
		    	        	        		xtype: "combo", maxLength: 25, vtype:'letra', //28-09-2012 Agregado por Ricardo Ardon
		                                    id: "ctgAreaConocmientoId",
		                                    name: "redOfertaConocimiento.ctgAreaConocmiento.ctgCatalogoId",
		                                    fieldLabel: "Area de Conocmiento",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: config.catalogos.ctgAreaConocmientos || [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id",
		                                    allowBlank: false,
		                                    listeners: {
		                                    	change: function(){
		                                    		var currentValue = this.getValue();
		                                    		if(!Ext.isEmpty(currentValue)){
		                                    			var data = Asg.Combo.filter(currentValue, config.catalogos.ctgDetalleAreaConocimientos, 2);
		                                    			Asg.Combo.loadData("ctgDetalleAreasConocimientoId", data, false);
		                                			}else if(Ext.isEmpty(this.getValue())){
		                                				Asg.Combo.removeAll("ctgDetalleAreasConocimientoId", false);
		                                            }
		                                        }
		                                    }
		                                },{
		                                	xtype: "combo", maxLength: 25, vtype:'letra', //28-09-2012 Agregado por Ricardo Ardon
		                                    id: "ctgDetalleAreasConocimientoId",
		                                    name: "redOfertaConocimiento.ctgDetalleAreasConocimiento.ctgDetalleAreaConocimientoId",
		                                    fieldLabel: "Detalle Conocimiento",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id"
		                            	},{
		                            		xtype: "grid",
		                            		id: "redOfertaConocimientoGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaConocimientoId",
													"ctgAreaConocmientoNombre",
													"ctgDetalleAreaConocimientoDescripcion"
												],
												data: config.redOfertaConocimientoList || [],
												groupers: [{property: "ctgAreaConocmientoNombre"}]
		                            		}),
		                            		features: [
                                               {ftype: "grouping", groupHeaderTpl: "{name}"}
	                                        ],
		                            		columns: [
												{
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												     {
												  	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												  	   iconCls: "icon", 
												  	   handler: function(grid, rowIndex, colIndex) {
												  		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaConocimientoId");
												  	   }
												     }
												 ]
												},
                            		          {header: "Detalle Area de Conocimiento", dataIndex: "ctgDetalleAreaConocimientoDescripcion", flex: 1}
                        		            ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaConocimientosForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaConocimientosForm","redOfertaConocimientoGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 2
		    	        	        	}
	                            	]
			        	        },{
			        	        	xtype: "form",
						        	id: "redOfertaHabilidadForm",
			        	        	bodyPadding: "5 5 5 5",
			        	        	border: false,
			        	        	layout: {
			        	        		type: "table",
										columns: 2,
										tableAttrs: {
								            style: {width: "615px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300}),
			        	        	items: [
		    	        	        	{xtype: "label", text: "- Habilidades -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 2},
		    	        	        	{
		    	        	        		xtype: "combo", maxLength: 25, vtype:'letra', //28-09-2012 Agregado por Ricardo Ardon
		                                    id: "ctgHabilidadId",
		                                    name: "redOfertaHabilidad.ctgHabilidad.ctgCatalogoId",
		                                    fieldLabel: "Area de Habilidades",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: config.catalogos.ctgHabilidades || [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id",
		                                    allowBlank: false,
		                                    listeners: {
		                                    	change: function(){
		                                    		var currentValue = this.getValue();
		                                    		if(!Ext.isEmpty(currentValue)){
		                                    			var data = Asg.Combo.filter(currentValue, config.catalogos.ctgDetalleHabilidades, 2);
		                                    			Asg.Combo.loadData("ctgDetalleHabilidadesId", data, false);
		                                			}else if(Ext.isEmpty(this.getValue())){
		                                				Asg.Combo.removeAll("ctgDetalleHabilidadesId", false);
		                                            }
		                                        }
		                                    }
		                                },{
		                                	xtype: "combo", maxLength: 25, vtype:'letra', //28-09-2012 Agregado por Ricardo Ardon
		                                    id: "ctgDetalleHabilidadesId",
		                                    name: "redOfertaHabilidad.ctgDetalleHabilidades.ctgDetalleHabilidadId",
		                                    fieldLabel: "Detalle de Habilidades",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id"
		                            	},{
		                            		xtype: "grid",
		                            		id: "redOfertaHabilidadGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaHabilidadId",
													"ctgHabilidadNombre",
													"ctgDetalleHabilidadDescripcion"
												],
												data: config.redOfertaHabilidadList || [],
												groupers: [{property: "ctgHabilidadNombre"}]
		                            		}),
		                            		columns: [
	                        		           {
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												     {
												  	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												  	   iconCls: "icon", 
												  	   handler: function(grid, rowIndex, colIndex) {
												  		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaHabilidadId");
												  	   }
												     }
												 ]
												},
												{header: "Detalle de Habilidad", dataIndex: "ctgDetalleHabilidadDescripcion", flex: 1, minWidth: 150},
		                    		        ],
		                    		        features: [
                                               {ftype: "grouping", groupHeaderTpl: "{name}"}
	                                        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaHabilidadForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaHabilidadForm","redOfertaHabilidadGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 2
		    	        	        	},
			        	        	]
						        }
		        	        ]
				        },{
				        	id: "redOfertaPaso6",
				        	title: "Paso #6: Datos de la Entrevista",
				        	border: false,
				        	autoScroll: true,
				        	items: [
			        	        {
						        	xtype: "form",
						        	id: "redOfertaEntrevistaForm",
						        	bodyPadding: "5 5 5 5",
			        	        	border: false,
			        	        	layout: {
			        	        		type: "table",
										columns: 4,
										tableAttrs: {
								            style: {width: "610px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, colspan: 2}),
			        	        	items: [
										{xtype: "label", text: "- Datos de la Entrevista -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 4},
										{xtype: "label", text: "Lugar de desempe\u00F1o de actividades:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaLugarActividades",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaLugarActividades,
											maxLength: 25, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Lugar de entrevista:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaLugarEntrevista",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaLugarEntrevista,
											maxLength: 25, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Entrevistador:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaEntrevistador",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaEntrevistador,
											maxLength: 25, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Cargo:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaCargo",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaCargo,
											maxLength: 25, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Tel\u00E9fonos:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaTelefono",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaTelefono,
											vtype: "telefono",
											maxLength: 8, vtype:'telefono' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Email:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaEmail",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaEmail,
											vtype: "email",
											maxLength: 25, vtype: "email", //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Horario de Entrevista:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaHora",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaHora,
											maxLength: 25
										},
										{xtype: "label", text: "D\u00EDas de Entrevista:", cls: "x-form-item", width: 200},
										{
											xtype: "textfield",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaDia",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaDia,
											maxLength: 35, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},
										{xtype: "label", text: "Observaciones:", cls: "x-form-item", width: 200},
										{
											xtype: "textarea",
											name: "redOfertaDatosEntrevista.redOfertaDatoEntrevistaObservaciones",
											value: config.redOfertaDatosEntrevista.redOfertaDatoEntrevistaObservaciones,
											height: 50,
											maxLength: 75, vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
										},{
		    	        	        		xtype: "hidden",
		    	        	        		name: "redOfertaDatosEntrevista.redOfertaDatosEntrevistaId",
		    	        	        		value: config.redOfertaDatosEntrevista.redOfertaDatosEntrevistaId,
		    	        	        		width: 10
		    	        	        	}
									]
			        	        },{
			        	        	xtype: "form",
						        	id: "redOfertaSucursalesForm",
						        	bodyPadding: "5 5 5 5",
			        	        	border: false,
			        	        	layout: {
			        	        		type: "table",
										columns: 4,
										tableAttrs: {
								            style: {width: "610px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, colspan: 2}),
			        	        	items:[
		    	        	        	{xtype: "label", text: "- Sucursales -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 4},
		    	        	        	{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalNombre",
		    	        	        		fieldLabel: "Nombre",
		    	        	        		allowBlank: false,
		    	        	        		vtype: "letra",
		    	        	        		maxLength: 200
		    	        	        	},{
		    	        	        		xtype: "combo",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalOficina",
		    	        	        		fieldLabel: "Es oficina Central",
		    	        	        		store: new Ext.data.SimpleStore({
		                                        data: Asg.Combo.yesnoArray(),
		                                        fields: ["id", "value"]
			                                }),
			                                displayField: "value",
			                                valueField: "id"
		    	        	        	},{
		    	        	        		xtype: "textarea",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalDireccion",
		    	        	        		fieldLabel: "Direccio\u00F3n",
		    	        	        		height: 50,
		    	        	        		maxLength: 250,
		    	        	        		width: 600,
		    	        	        		colspan: 4,
		    	        	        		vtype:"letra"
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalTelefono",
		    	        	        		fieldLabel: "Tel\u00E9fono",
		    	        	        		allowBlank: false,
		    	        	        		vtype: "telefono",
		    	        	        		maxLength: 8,
		    	        	        		width: 140,
		    	        	        		colspan: 1
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalFax",
		    	        	        		fieldLabel: "FAX",
		    	        	        		vtype: "telefono",
		    	        	        		maxLength: 8,
		    	        	        		width: 150,
		    	        	        		colspan: 1
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalEmail",
		    	        	        		fieldLabel: "Email",
		    	        	        		vtype: "email",
		    	        	        		maxLength: 250
		    	        	        	},{
		                                    xtype: "combo",
		                                    id: "ctgDepartamentoId",
		                                    name: "redOfertaSucursales.ctgDepartamento.ctgDepartamentoId",
		                                    fieldLabel: "Departamento",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: config.catalogos.ctgDepartamentos || [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id",
		                                    listeners: {
		                                    	change: function(){
		                                    		var currentValue = this.getValue();
		                                    		if(!Ext.isEmpty(currentValue)){
		                                    			var data = Asg.Combo.filter(currentValue, config.catalogos.ctgMunicipios, 2);
		                                    			Asg.Combo.loadData("ctgMunicipioId", data, false);
		                                    			Asg.Form.setRequired("ctgMunicipioId", true);
		                                			}else if(Ext.isEmpty(this.getValue())){
		                                				Asg.Combo.removeAll("ctgMunicipioId", false);
		                                                Asg.Form.setRequired("ctgMunicipioId", false);
		                                            }
		                                        }
		                                    }
		                                },{
		                                    xtype: "combo",
		                                    id: "ctgMunicipioId",
		                                    name: "redOfertaSucursales.ctgMunicipio.ctgMunicipioId",
		                                    fieldLabel: "Municipio",
		                                    store: new Ext.data.SimpleStore({
		                                    	data: [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id"
		                            	},{
		                            		xtype: "grid",
		                            		id: "redOfertaSucursalGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaSucursales.redOfertaSucursalId",
													"redOfertaSucursales.redOfertaSucursalNombre",
													"redOfertaSucursales.redOfertaSucursalOficina",
													"redOfertaSucursales.redOfertaSucursalDireccion",
													"redOfertaSucursales.redOfertaSucursalTelefono",
													"redOfertaSucursales.redOfertaSucursalFax",
													"redOfertaSucursales.redOfertaSucursalEmail",
													"redOfertaSucursales.ctgDepartamento.ctgDepartamentoId",
													"redOfertaSucursales.ctgDepartamento.ctgDepartamentoNombre",
													"redOfertaSucursales.ctgMunicipio.ctgMunicipioId",
													"redOfertaSucursales.ctgMunicipio.ctgMunicipioNombre"
												],
												data: config.redOfertaSucursalesList || []
		                            		}),
		                            		selModel: {
							        			listeners: {
							        				selectionchange: function(selectionModel, records){
							        					RedOferta.selectionChange(records, "redOfertaSucursalesForm");
							        				}
							        			}
		                            		},
		                            		columns: [
		                        		          {
													   xtype: "actioncolumn",
													   width: 30,
													   hidden: false,
													   items: [
												     {
												  	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
												  	   iconCls: "icon", 
												  	   handler: function(grid, rowIndex, colIndex) {
												  		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaSucursales.redOfertaSucursalId");
												  	   }
												     }
												 ]
												},
												{header: "Nombre", dataIndex: "redOfertaSucursales.redOfertaSucursalNombre", flex: 1, minWidth: 150},
		                        		          {header: "Tel\u00E9fono", dataIndex: "redOfertaSucursales.redOfertaSucursalTelefono", width: 80},
		                        		          {header: "Email", dataIndex: "redOfertaSucursales.redOfertaSucursalEmail", width: 150},
		                        		          {header: "Departamento", dataIndex: "redOfertaSucursales.ctgDepartamento.ctgDepartamentoNombre", width: 150},
		                        		          {header: "Municipio", dataIndex: "redOfertaSucursales.ctgMunicipio.ctgMunicipioNombre", width: 150}
		                    		        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaSucursalesForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaSucursalesForm","redOfertaSucursalGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 4
		    	        	        	},{
		    	        	        		xtype: "hidden",
		    	        	        		name: "redOfertaSucursales.redOfertaSucursalId",
		    	        	        		width: 10
		    	        	        	}
	                            	]
			        	        },{
			        	        	xtype: "form",
						        	id: "redOfertaContactoForm",
						        	bodyPadding: "5 5 5 5",
			        	        	border: false,
			        	        	layout: {
			        	        		type: "table",
										columns: 4,
										tableAttrs: {
								            style: {width: "610px", "margin-top": "5px;"},
								            align: "center"
										}
			        	        	},
			        	        	defaults: Asg.Form.defaults({labelAlign: "top", width: 300, colspan: 2}),
			        	        	items:[
		    	        	        	{xtype: "label", text: "- Contactos -", cls: "x-form-item", style: "text-align: center; font-weight: bold", colspan: 4},
		    	        	        	{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoNombres",
		    	        	        		fieldLabel: "Nombres",
		    	        	        		allowBlank: false,
		    	        	        		maxLength: 25,
		    	        	        		vtype:'letra' //28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoApellidos",
		    	        	        		fieldLabel: "Apellidos",
		    	        	        		allowBlank: false,
		    	        	        		maxLength: 25,
		    	        	        		vtype:'letra' //28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoPuesto",
		    	        	        		fieldLabel: "Puesto",
		    	        	        		maxLength: 25,
		    	        	        		vtype:'letranum' //28-09-2012 Agregado por Ricardo Ardon
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoTelefono",
		    	        	        		fieldLabel: "Tel\u00E9fono",
		    	        	        		allowBlank: false,
		    	        	        		vtype: "telefono",
		    	        	        		maxLength: 8,
		    	        	        		width: 140,
		    	        	        		colspan: 1
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoFax",
		    	        	        		fieldLabel: "FAX",
		    	        	        		vtype: "telefono",
		    	        	        		maxLength: 8,
		    	        	        		width: 150,
		    	        	        		colspan: 1
		    	        	        	},{
		    	        	        		xtype: "textfield",
		    	        	        		name: "redOfertaContacto.redOfertaContactoEmail",
		    	        	        		fieldLabel: "Email",
		    	        	        		vtype: "email",
		    	        	        		maxLength: 250
		    	        	        	},{
		                                    xtype: "combo",
		                                    id: "redOfertaContactoSucursalId",
		                                    name: "redOfertaContacto.redOfertaSucursales.redOfertaSucursalId",
		                                    fieldLabel: "Sucursal",
		                                    allowBlank: false,
		                                    store: new Ext.data.SimpleStore({
		                                    	data: config.redOfertaSucursalesList || [],
		                                    	fields: ["id", "value"]
		                                    }),
		                                    displayField: "value",
		                                    valueField: "id",
		                                    colspan: 4
		                                },{
		                            		xtype: "grid",
		                            		id: "redOfertaContactoGrid",
		                            		store: new Ext.data.SimpleStore({
		                            			fields: [
													"redOfertaContacto.redOfertaContactoId",
													"redOfertaContacto.redOfertaContactoNombreCompleto",
													"redOfertaContacto.redOfertaContactoNombres",
													"redOfertaContacto.redOfertaContactoApellidos",
													"redOfertaContacto.redOfertaContactoPuesto",
													"redOfertaContacto.redOfertaContactoTelefono",
													"redOfertaContacto.redOfertaContactoCelular",
													"redOfertaContacto.redOfertaContactoEmail",
													"redOfertaContacto.redOfertaSucursales.redOfertaSucursalId",
													"redOfertaSucursal.redOfertaSucursalNombre"
												],
												data: config.redOfertaContactoList || []
		                            		}),
		                            		selModel: {
							        			listeners: {
							        				selectionchange: function(selectionModel, records){
							        					RedOferta.selectionChange(records, "redOfertaContactoForm");
							        				}
							        			}
		                            		},
		                            		columns: [
		                            		      {
						                        	   xtype: "actioncolumn",
						                        	   width: 30,
							        	        	   hidden: false,
							        	        	   items: [
						        	        	           {
						        	        	        	   icon: Asg.constants.CONTEXT_PATH + "/resources/images/delete.png", 
						        	        	        	   iconCls: "icon", 
						        	        	        	   handler: function(grid, rowIndex, colIndex) {
						        	        	        		   RedOferta.confirmProcess(grid, rowIndex, "redOfertaContacto.redOfertaContactoId");
						        	        	        	   }
						        	        	           }
						    	        	           ]
						                          },
		                        		          {header: "Nombre Completo", dataIndex: "redOfertaContacto.redOfertaContactoNombreCompleto", flex: 1, minWidth: 150},
		                        		          {header: "Puesto", dataIndex: "redOfertaContacto.redOfertaContactoPuesto", width: 130},
		                        		          {header: "Tel\u00E9fono", dataIndex: "redOfertaContacto.redOfertaContactoTelefono", width: 80}
		                    		        ],
		                    		        tbar: [
		                		               "->",
		                		               {
		                		            	   text: "Nuevo",
		                		            	   iconCls: Asg.constants.ADD_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.resetFormDetails("redOfertaContactoForm");
		                		            	   }
		                		               },{
		                		            	   text: "Guardar",
		                		            	   iconCls: Asg.constants.SAVE_ICON,
		                		            	   handler: function(){
		                		            		   RedOferta.saveDetails("redOfertaContactoForm","redOfertaContactoGrid");
		                		            	   }
		                		               }
		            		                ],
		    	        	        		width: 605,
		    	        	        		height: 200,
		    	        	        		colspan: 4
		    	        	        	},{
								        	xtype: "hidden",
								        	name: "redOfertaContacto.redOfertaContactoId",
								        	width: 10
								        }
			        	        	]
						        }
		        	        ]
				        },{
				        	title: "Paso #7: Revisi\u00F3n de la Informaci\u00F3n",
				        	border: false,
				        	items: [
								{xtype: "label", text: "Informacion de oferta almacenada exitosamente. La oferta se encuentra activa y lista para ser procesada.", cls: "x-form-item"}    
//			        	        {xtype: "label", text: "Ahora que ha completado y guardado los datos de la oferta se necesita que \u00E9sta sea activada en el " +
//			        	        		"Sistema RED para que los Demandantes registrados puedan ser vinculados", cls: "x-form-item"}
		        	        ]
				        }
			        ],
			        bbar: [
		               "->",
		               {
		            	   text: "Anterior",
		            	   id: "redOfertaSiguienteButton",
		            	   handler: function(btn) {
		            		   RedOferta.navigate(btn.up("panel"), "prev");
		                   },
		                   disabled: true
		               },"-",
		               {
		            	   text: "Siguiente",
		            	   id: "redOfertaAnteriorButton",
		            	   handler: function(btn) {
		            		   RedOferta.navigate(btn.up("panel"), "next");
		                   }
		               }, "-",
		               {
		            	   text: "Cerrar",
		            	   handler: function(){
		            		   Ext.WindowMgr.get("redOfertaWindow").close();
	            		   }
		               }
	                ]
				}
			}).show();
		}
	};
}();